//
//  JJFriendGroup.m
//  List
//
//  Created by itclimb on 2017/8/1.
//  Copyright © 2017年 itclimb.yuancheng.com. All rights reserved.
//

#import "JJFriendGroup.h"

@implementation JJFriendGroup

- (instancetype)initWithDict:(NSDictionary *)dict
{
    self = [super init];
    if (self) {
        
        [self setValuesForKeysWithDictionary:dict];
        //二次字典转模型
        NSMutableArray *arrM = [NSMutableArray arrayWithCapacity:self.friends.count];
        [self.friends enumerateObjectsUsingBlock:^(NSDictionary *dict, NSUInteger idx, BOOL * _Nonnull stop) {
            JJFriend *friend = [JJFriend friendWithDict:dict];
            [arrM addObject:friend];
        }];
        self.friends = arrM.copy;
    }
    return self;
}

+ (instancetype)friendGroupWithDict:(NSDictionary *)dict{
    
    return [[self alloc] initWithDict:dict];
}

@end
